package org.neptune.common.util;

import java.util.UUID;

import org.apache.commons.lang3.StringUtils;
import org.neptune.common.constant.CharacterConstant;

/** @description 随机帮助类 */
public class RandomUtils {

	/**
	 * 创建随机uuid
	 *
	 * @return 创建的随机uuid
	 */
	public static String createRandomUUID() {
		UUID uuid = UUID.randomUUID();
		return uuid.toString().replace(CharacterConstant.HYPHEN, "");
	}

	/**
	 * 获取16位的字符串
	 * <p>
	 * 可作为秘钥，偏移量
	 * </p>
	 * 
	 * @return
	 */
	public static String get16Str() {

		return StringUtils.substring(createRandomUUID(), 0, 16);
	}

}
